%function show_eye_EL1k
enableCallbacks = 'PsychEyelinkDispatchCallback'; %special secret ninja hidden code
home;
if Eyelink('Initialize', enableCallbacks) ~= 0
    fprintf('Initialize Eyelink failed \n')
    return;    
end
screenRect=get(0,'ScreenSize');
screenpixW=screenRect(3);
screenpixH=screenRect(4);

ListenChar(2);%enable listening, additionally any output of keypresses to Matlab windows is suppressed.
Screen('Preference','SkipSyncTests',1);
Screen ('Preference','VisualDebugLevel',0);
Screen('Preference','SuppressAllWarnings',1);
[w]=Screen('OpenWindow', 1, 0,[],32,2);
Screen(w,'BlendFunction',GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
pause(.01);
el = EyelinkInitDefaults(w);%el=elglobal; %make it local and usable
%their default is the inverse of this:
el.backgroundcolour = 0;% bcoe
el.foregroundcolour = 255;% bcoe
el.msgfontcolour    = 128;% bcoe
el.imgtitlecolour   = 128;% bcoe
el.calibrationtargetcolour=el.foregroundcolour;
el.eyeimgsize=screenpixW/20+10;
%el.msgfont='Tahoma';
el.msgfontsize=12;
%el.imgtitlefont='Tahoma';
el.imgtitlefontsize=12;
el.helptext='hit the enter key!\n\nlateral arrow keys change image\n\nvertcal arrow keys change threshold\n\nESC to exit';
EyelinkUpdateDefaults(el);
pause(1);
fprintf(' entered EyelinkDoTrackerSetup\n')
%EyelinkDoTrackerSetup(el,el.ENTER_KEY);
result = Eyelink('StartSetup', 1 );
fprintf('  exited EyelinkDoTrackerSetup\n')
Eyelink('shutdown');
Screen('Closeall');
ListenChar(0);
